<div class="form-inline">
    <div class="well">
        <?php
        /** @var ContactosController $this */
        /** @var Contactos $model */
        /** @var AweActiveForm $form */
        $form = $this->beginWidget('ext.AweCrud.components.AweActiveForm', array(
            'type' => 'horizontal',
            'id' => 'contactos-form',
            'enableAjaxValidation' => false,
            'clientOptions' => array('validateOnSubmit' => true, 'validateOnChange' => false,),
            'enableClientValidation' => true,
        ));
        ?>




        <div class="row-fluid">
            <div class="span6">
                <?php echo $form->textFieldRow($model, 'nombres', array('maxlength' => 45)) ?>
            </div>

            <div class="span6">
                <?php echo $form->textFieldRow($model, 'apellidos', array('maxlength' => 45)) ?>
            </div>

        </div>

        <div class="row-fluid">
            <div class="span6">
                <?php echo $form->textFieldRow($model, 'documento', array('maxlength' => 45)) ?>
            </div>

            <div class="span6">
                <?php echo $form->textFieldRow($model, 'telefono', array('maxlength' => 45)) ?>
            </div>

        </div>

        <div class="row-fluid">
            <div class="span6">
                <?php echo $form->textFieldRow($model, 'celular', array('maxlength' => 45)) ?>
            </div>
            <div class="span6">
                <?php echo $form->dropDownListRow($model, 'pais_id', CHtml::listData(Paises::model()->findByPk(1)->findAll(), 'id', Paises::representingColumn())) ?>
            </div>

        </div>

        <div class="row-fluid">

            <div class="span6">
                <?php
                echo $form->dropDownListRow($model, 'provincia_id', array('' => ' -- Seleccione -- ') + CHtml::listData(Provincias::model()->findByAttributes(array('paises_id' => 1))->findAll(), 'id', Provincias::representingColumn()), array(
                    'ajax' => array(
                        'type' => 'POST',
                        'url' => Yii::app()->baseUrl . '/index.php/cuentas/contactos/cargarCiudades',
                        'success' => 'js:function(data){$("#Contactos_ciudad_id").html(data)}',
                    )
                        )
                )
                ?>
            </div>
            <div class="span6">
                <?php echo $form->dropDownListRow($model, 'ciudad_id', array('' => ' -- Seleccione -- ') + CHtml::listData(Ciudad::model()->de_provincia_id($model->provincia_id)->findAll(), 'id', Ciudad::representingColumn())) ?>
            </div>
        </div>
        <div class="row-fluid">

            <div class="span6">
                <?php echo $form->textFieldRow($model, 'calle_principal', array('maxlength' => 45)) ?>
            </div>
            <div class="span6">
                <?php echo $form->textFieldRow($model, 'calle_secundaria', array('maxlength' => 45)) ?>
            </div>
        </div>

        <center>
            <div class="span12">
                <?php
                $this->widget('bootstrap.widgets.TbButton', array(
                    'buttonType' => 'submit',
                    'type' => 'primary',
                    'label' => $model->isNewRecord ? Yii::t('AweCrud.app', 'Registrame') : Yii::t('AweCrud.app', 'Save'),
                ));
                ?>
                <?php
                $this->widget('bootstrap.widgets.TbButton', array(
                    //'buttonType'=>'submit',
                    'label' => Yii::t('AweCrud.app', 'Cancel'),
                    'htmlOptions' => array('onclick' => 'javascript:history.go(-1)')
                ));
                ?>
            </div>

            <?php $this->endWidget(); ?>
        </center>
    </div>
</div>